//
//  ByViewCardAndPayHeader.m
//  chequanbao_ios
//
//  Created by mc on 2017/5/9.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "ByViewCardAndPayHeader.h"
#import "UILabel+YBAttributeTextTapAction.h"

@implementation ByViewCardAndPayHeader

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        [self createViews];
    }
    return self;
}

-(void)createViews{
//    NSString *str = @"该功能用于会员推广 查看详情";
//    CGFloat width = [str getSizeOfString:14].width;
//    CGFloat x = (SCREEN_WIDTH - width)/2;
//    CGFloat p_width = [@"该功能用于会员推广" getSizeOfString:14].width;
//    UIButton *lookBtn = [[UIButton alloc] initWithFrame:CGRectMake(x + p_width, 10, width - p_width, 20)];
//    [lookBtn setTitle:@"查看详情" forState:UIControlStateNormal];
//    [lookBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    lookBtn.titleLabel.font = B_FONT(14);
//    [lookBtn addTarget:self action:@selector(lookAction:) forControlEvents:UIControlEventTouchUpInside];
//    [self addSubview:lookBtn];
//    
//    UILabel *infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(x, 10, p_width, 20)];
//    infoLabel.font = FONT(14);
//    infoLabel.textColor = [UIColor colorWithWhite:0.95 alpha:1];
//    infoLabel.text = @"该功能用于会员推广";
//    [self addSubview:infoLabel];
    
//    UILabel *infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, SCREEN_WIDTH - 20, 20)];
//    infoLabel.textAlignment = NSTextAlignmentCenter;
//    NSString *str = @"该功能用于会员推广 查看详情";
////    infoLabel.enabledTapEffect = NO;
//    
//    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:str];
//    [attrStr addAttribute:NSFontAttributeName value:FONT(14) range:NSMakeRange(0, str.length - 5)];
//    [attrStr addAttribute:NSFontAttributeName value:B_FONT(14) range:NSMakeRange(9, 5)];
//    [attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(9, 5)];
//    [attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithWhite:0.95 alpha:1] range:NSMakeRange(0, 9)];
//    
//    [infoLabel setAttributedText:attrStr];
//    [self addSubview:infoLabel];
//    [infoLabel yb_addAttributeTapActionWithStrings:@[@"查看详情"] tapClicked:^(NSString *string, NSRange range, NSInteger index) {
//        [ByCoreToolAlert showOnlyText:@"点我"];
//                NSString *str = [NSString stringWithFormat:@"https://api.ryzcgf.com/public/web.php/web/copyright"];
//                ByWebViewController *vc = [[ByWebViewController alloc] initWithTotalUrlString:str];
//                vc.titleString = @"用户服务协议";
//                ByBaseVC *superVC = (ByBaseVC *)self.viewController;
//                [superVC by_normalPush:vc hasNavi:YES];
//    }];
    
}

- (void)lookAction:(UIButton *)button{
    [ByCoreToolAlert showOnlyText:@"查看详情"];
}
@end
